package com.liuluo.homework1025hou.Controller


import com.liuluo.homework1025hou.dto.LoginIn
import com.liuluo.homework1025hou.service.CustomerService
import org.springframework.web.bind.annotation.*

@RestController
@CrossOrigin("*")
@RequestMapping("/user")
class CustomerController(private val customerService: CustomerService) {

//    @PostMapping("/login")
//    fun login(@RequestBody login: LoginIn): Int {
//        val token:Int = customerService.Login(login.account, login.password)
//        if(){
//            return 1233331
//        }
//        else{
//            return 0
//        }
//    }

    @PostMapping("/login")
    fun login(@RequestBody login: LoginIn): Int {
        val res = customerService.Login(login.account, login.password)
        return res
    }

}